package bsc.war.mail;

import bsc.ejb.entity.Person;
import bsc.ejb.entity.ScoreCard;
import bsc.ejb.metadata.SMTP;
import java.util.TimerTask;
import javax.servlet.ServletContext;
import bsc.war.mail.MailUtils.Type;


/**
 *
 * @author Memo
 */
public class SendMailTask extends TimerTask{
    Person person;
    ScoreCard scoreCard;
    SMTP smtp;
    Type type;
    ServletContext servletContext;

    public SendMailTask(Person person, ScoreCard scoreCard, Type type, SMTP smtp, ServletContext servletContext){
        this.person = person;
        this.scoreCard = scoreCard;
        this.smtp = smtp;
        this.type = type;
        this.servletContext = servletContext;
    }
    
    public void run(){
        MailUtils.sendMail(person, scoreCard, type, smtp, servletContext);
    }
}
